package cn.tedu.boot04.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BmiController {
    @RequestMapping("/bmi")
    public String bmi(double h,double w ){
        double bmi = w/(h*h);
        if(bmi<=18.5){
            return "偏瘦,bim="+bmi;
        }
        if(bmi<=24){
            return "正常,bim="+bmi;
        }
        if(bmi<=28){
            return "微胖,bim="+bmi;
        }
        return "胖，bim="+bmi;
    }
}
